﻿@using Topro.Entity.Response.Info
@using Topro.Entity.Enum
@using Topro.Util

@model Topro.Entity.PagedList<InfoQueryResponse>

<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l">内容</th>
                        <th class="t_c" width="75">值</th>
                        <th class="t_c" width="75">类型</th>
                        <th class="t_c" width="75">状态</th>
                        <th class="t_c" width="150">创建时间</th>
                        <th class="t_c" width="120">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (List<Topro.Entity.Response.Info.InfoQueryResponse>)Model.TData)
                        {
                    <tr>
                        <td class="t_l">@(item.Message)</td>
                        <td class="t_c">@(item.Value)</td>
                        <td class="t_c">@(EnumUtil.GetDescription(typeof(InfoType),(Object)item.Type))</td>
                        <td class="t_c" width="75">
                            @(item.Status == (sbyte)InfoStatus.启用?Html.Raw("<span class='green bold'>启用</span>"):Html.Raw("<span class='red bold'>禁用</span>"))
                        </td>
                        <td class="t_c" width="150">@(item.CreatedDate.ToString("yyyy-MM-dd HH:mm:ss"))</td>
                        <td>
                            @if (item.Status == (sbyte)InfoStatus.启用)
                            {
                                <a class="btn btn-danger btn-xs" data-confirm="确定要禁用该记录？" data-succesFun="doSearch()" data-href="/Info/UpdateStatus?id=@(item.Id)&status=@((sbyte)InfoStatus.禁用)">禁用</a>
                            }
                            else
                            {
                                <a class="btn btn-primary btn-xs" data-confirm="确定要启用该记录？" data-succesFun="doSearch()" data-href="/Info/UpdateStatus?id=@(item.Id)&status=@((sbyte)InfoStatus.启用)">启用</a>
                            }
                            <button type="button" class="btn btn-default btn-xs" data-modal="/Info/AddOrEdit/@(item.Id)" data-title="编辑" data-width="452" data-height="200">
                                <span class="glyphicon glyphicon-edit"></span> 编辑
                            </button>
                        </td>
                    </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="6" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />